#include "DemoAnimInstance.h"

#include "GameFramework/PawnMovementComponent.h"

void UDemoAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
	Super::NativeUpdateAnimation(DeltaSeconds);
	const APawn* Pawn = TryGetPawnOwner();
	if (!Pawn) { return; }
	Speed = Pawn -> GetVelocity() . Length();
	const UPawnMovementComponent* MovementComponent = Pawn -> GetMovementComponent();
	if (!MovementComponent) { return; }
	bIsInAir = MovementComponent -> IsFalling();
}
